package com.coderknock.jedis.push;

import org.junit.jupiter.api.Test;
import redis.clients.jedis.Jedis;

public class pubSubTest {
    @Test
    public void pubSubTest(){
//获得Jedis
        Jedis jedis1 = JedisFactory.getJedis();
        Jedis jedis2 = JedisFactory.getJedis();
        PushSubListener listener = new PushSubListener();
        //发布  channel message
        Publisher publisher = new Publisher();
        publisher.publish(jedis2);
        //订阅
        Subscriber1 scribe = new Subscriber1();
        scribe.sub(jedis1, listener);
    }
}
